package com.powerbank.ordercenter.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 订单日志实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_log")
public class OrderLog {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 订单ID
     */
    @TableField("order_id")
    private Long orderId;

    /**
     * 订单号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 操作类型：CREATE,PAYMENT,START,RETURN,CANCEL,REFUND
     */
    @TableField("operation_type")
    private String operationType;

    /**
     * 操作前状态
     */
    @TableField("before_status")
    private String beforeStatus;

    /**
     * 操作后状态
     */
    @TableField("after_status")
    private String afterStatus;

    /**
     * 操作用户ID
     */
    @TableField("operator_id")
    private Long operatorId;

    /**
     * 操作用户类型：USER,ADMIN,SYSTEM
     */
    @TableField("operator_type")
    private String operatorType;

    /**
     * 操作描述
     */
    @TableField("operation_desc")
    private String operationDesc;

    /**
     * 操作详情（JSON格式）
     */
    @TableField("operation_detail")
    private String operationDetail;

    /**
     * 操作IP
     */
    @TableField("operation_ip")
    private String operationIp;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;
}